package com.study.springBoot.config;


import org.apache.activemq.command.ActiveMQQueue;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.jms.annotation.EnableJms;

import javax.jms.Queue;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

@SpringBootConfiguration
//@Component
@EnableJms
public class SpringBootConfig {

    @Bean
    public Queue mySpringBootQueue(){
        System.out.println(11111111);

        ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor
                (5,5,1000,
                        TimeUnit.SECONDS,new LinkedBlockingQueue<>(100),
                        Executors.defaultThreadFactory(),new ThreadPoolExecutor.AbortPolicy());
        return new ActiveMQQueue("my_springBoot_queue");
    }
}
